import { isEmpty } from '@/common/helper/is'
export default {
  data() {
    return {}
  },
  // 侦听属性
  watch: {},
  // 计算属性
  computed: {
    // 分享信息
    shareInfo() {
      if (!isEmpty(this.onSharePageConfig)) {
        this.$Platform.share.updateShareInfo(this.onSharePageConfig)
        return this.onSharePageConfig
      }
      return this.$Platform.share.getShareInfo()
    },
  },
  //
  onPageScroll(e) {},
  // 监听页面加载，该钩子被调用时，响应式数据、计算属性、方法、侦听器、props、slots 已设置完成
  onLoad(options) {},
  // 监听页面显示，页面每次出现在屏幕上都触发
  onShow() {
    // if (!isEmpty(this.shareInfo)) {
    //   this.$Platform.share.updateShareInfo(this.shareInfo)
    // }
  },
  // 监听页面初次渲染完成，此时组件已挂载完成
  onReady() {},
  // 下拉刷新
  onPullDownRefresh() {},
  // 加载更多
  onReachBottom() {},

  created() {},
  mounted() {},
  destroyed() {},
  methods: {},

  // #ifdef MP-WEIXIN
  // 微信小程序分享
  onShareAppMessage(e) {
    console.log('🚀 ~ onShareAppMessage ~ e:', e)
    return {
      title: this.shareInfo.title,
      path: this.shareInfo.path,
      imageUrl: this.shareInfo.image,
      // desc: this.shareInfo.desc,
    }
  },
  onShareTimeline(e) {
    console.log('🚀 ~ onShareTimeline ~ e:', e)
    return {
      title: this.shareInfo.title,
      query: this.shareInfo.query,
      imageUrl: this.shareInfo.image,
      // desc: this.shareInfo.desc,
    }
  },
  // #endif
}
